﻿using System;
using System.Net;
using System.Collections.ObjectModel;
using System.Collections.Generic;

namespace Airport
{
    public abstract class Surface
    {

        private int _surfaceId;
        private int _maxWeight;
        private bool _isOpen;
        private int _length;
        private int _width;
        private int _elevation;
        private string _name;
        private List<Node> _nodes;

        /// <summary>
        /// Default <c>Surface</c> constructor
        /// </summary>
        public Surface()
            : this(-1, "", -1, -1, -1, -2147483648)
        {
            // The elevation is set to the smallest int value
            _isOpen = false;  // Default to Closed if empty
        }

        public Surface(int id, string n, int maxW, int len, int wid, int elev)
        {
            _surfaceId = id;
            _name = n;
            _maxWeight = maxW;
            _length = len;
            _width = wid;
            _elevation = elev;
            _isOpen = true;   // Default to Open if explicitly created 
            nodes = new List<Node>();
        }

        public int surfaceId
        {
            get
            {
                return _surfaceId;
            }

            set
            {
                if (_surfaceId != value)
                {
                    _surfaceId = value;
                }
            }
        }

        public int maxWeight
        {
            get
            {
                return _maxWeight;
            }

            set
            {
                if (_maxWeight != value)
                {
                    _maxWeight = value;
                }
            }
        }

        public bool isOpen
        {
            get
            {
                return _isOpen;
            }

            set
            {
                if (_isOpen != value)
                {
                    _isOpen = value;
                }
            }
        }

        public int length
        {
            get
            {
                return _length;
            }

            set
            {
                if (_length != value)
                {
                    _length = value;
                }
            }
        }
 
        public int width
        {
            get
            {
                return _width;
            }

            set
            {
                if (_width != value)
                {
                    _width = value;
                }
            }
        }
   
        public int elevation
        {
            get
            {
                return _elevation;
            }

            set
            {
                if (_elevation != value)
                {
                    _elevation = value;
                }
            }
        }
    
        public string name
        {
            get
            {
                return _name;
            }

            set
            {
                if (_name != value)
                {
                    _name = value;
                }
            }
        }

        public List<Node> nodes
        {
            get
            {
                return _nodes;
            }

            set
            {
                if (_nodes != value)
                {
                    _nodes = value;
                }
            }
        }

        

    }
}
